#include <iostream>
#include <cmath>
using namespace std;

#define int long long 

signed main() {
    int n;
    cin >> n;
    int left = sqrt(n);
    int right = left + 1;
    int ans = abs(left * left - n) > abs(right * right - n) ? right * right : left * left;
    cout << ans << endl;
    return 0;
}
// 64 位输出请用 printf("%lld")